package main

import (
	"flag"
	"fmt"
	"strings"
)

type AdminInfo struct {
	Username string
	Password string
}

func (a AdminInfo) String() string {
	return a.Username
}

func (a *AdminInfo) Set(value string) error {
	for i, dt := range strings.Split(value, ",") {
		if i == 1 {
			a.Username = dt
		} else if i == 2 {
			a.Password = dt
		}
	}
	return nil
}

func main() {
	a := AdminInfo{}
	flag.Var(&a, "run", "run api|rpc")
	flag.Parse()
	fmt.Printf("sL %s", a)
}
